package com.atguigu.gmall.all.controller;

import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.order.client.OrderFeignClient;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.Map;

/**
 * @author Fxz
 * @version 1.0
 * @date 2022-02-19 19:51
 */
@Controller
@RequiredArgsConstructor
public class OrderController {

	private final OrderFeignClient orderFeignClient;

	@GetMapping("trade.html")
	public String trade(Model model) {
		Result trade = orderFeignClient.trade();
		model.addAllAttributes((Map) trade.getData());
		return "order/trade";
	}

}
